package com.example.mmlist2.storage.entity;

public class Account {
    //id
    private int id;
    //用户名
    private String username;
    //密码
    private String password;
    //标题
    private String title;
    //链接
    private String link;
    //描述
    private String illustrate;


    // 构造方法
    public Account(String id, String username, String password, String title, String link, String illustrate) {
        this.id = id.equals("") ? 0 : Integer.parseInt(id);
        this.username = username;
        this.password = password;
        this.title = title;
        this.link = link;
        this.illustrate = illustrate;
    }

    public Account(String username, String password, String title, String link, String illustrate) {
        this.username = username;
        this.password = password;
        this.title = title;
        this.link = link;
        this.illustrate = illustrate;
    }

    public Account(String id, String username, String title) {
        this.id = Integer.parseInt(id);
        this.username = username;
        this.title = title;
    }

    public Account() {
    }

    // Getter 和 Setter 方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public String getIllustrate() {
        return illustrate;
    }

    public void setIllustrate(String description) {
        this.illustrate = description;
    }

    // toString 方法，用于调试或日志输出  
    @Override
    public String toString() {
        return "Account{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", title='" + title + '\'' +
                ", link='" + link + '\'' +
                ", illustrate='" + illustrate + '\'' +
                '}';
    }
}